package com.xlobo.api.inventory.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.xlobo.api.inventory.parameter.GetInventoryInfoByUserIdBean;
import com.xlobo.api.inventory.service.GetInventoryInfoByUserIdCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymt.utils.tag.P3;

/**
 * 根据用户编号获取库存信息接口 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_GetInventoryInfoByUserId {

	private static GetInventoryInfoByUserIdBean getInfoByIdBean;
	private static GetInventoryInfoByUserIdCall getInfoByIdCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("根据用户编号获取库存信息接口");
	}

	@Before
	public void caseUp() {
		getInfoByIdBean = new GetInventoryInfoByUserIdBean();
		getInfoByIdCall = new GetInventoryInfoByUserIdCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getInfoByIdCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetInventoryInfoByUserId_001() {
		Logger.start(true,"根据用户编号获取库存信息成功");
		try {
			getInfoByIdBean.setUserId("9F1712DA-350D-4504-B70E-0103D2F55776");
			getInfoByIdCall.setData(getInfoByIdBean);
			getInfoByIdCall.callService();
			Logger.comment("发送appcall报文:" + getInfoByIdCall.getEntityString());
			Logger.comment("返回appcall报文：" + getInfoByIdCall.getReturnData());
			Logger.verifyEquals("true", getInfoByIdCall.getSuccess(), "验证Code");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P3.class)
	@TestCase
	public void Tc_GetInventoryInfoByUserId_002() {
		Logger.start(true,"不输入必填项userId失败");
		try {
			// TODO 补全case代码
			org.junit.Assert.fail();
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}